#region (c) 2014 THN Solutions LLC. - All rights reserved
/*
Simplified BSD License (BSD)
Copyright (c) 2014, THN Solutions LLC. ( www.ThnSolutions.com )
Author: Nguyễn, M. Hải                 ( www.Minh-Hai.com     )
All rights reserved.

Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:

    * Redistributions of source code must retain the above copyright notice, this 
      list of conditions and the following disclaimer.

    * Redistributions in binary form must reproduce the above copyright notice, 
      this list of conditions and the following disclaimer in the documentation 
      and/or other materials provided with the distribution.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 
IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 
BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 
POSSIBILITY OF SUCH DAMAGE.
*/
#endregion

#region Record of Change
//             							CHANGE HISTORY
// -------------------------------------------------------------------------------------
// |   DATE    | DEVELOPER  | DESCRIPTION                                              |
// -------------------------------------------------------------------------------------
// | 04-Nov-09 | HaiNM      | First creation.                                          |
// -------------------------------------------------------------------------------------
//
#endregion

#region Record of Audit
//             							REVIEW HISTORY
// -------------------------------------------------------------------------------------
// |   DATE    | REVIEWER   | NOTES                                                    |
// -------------------------------------------------------------------------------------
// -------------------------------------------------------------------------------------
//
#endregion

#region Using directives
using System;
using System.Drawing;

using Thn;
#endregion

namespace Thn.Interface.Vcl
{
    /// <summary>
    /// The renderation context applicable for <see cref="Calendar"/>
    /// </summary>
#if DEBUG
    public
#else
    public
#endif
 class CalendarRenderContext : RenderContext
    {
        #region Header Region
        private Rectangle mHeaderRegion = Rectangle.Empty;
        /// <summary>
        /// Gets/Sets region for top navigation.
        /// </summary>
        public Rectangle HeaderRegion
        {
            get { return mHeaderRegion; }
            set { mHeaderRegion = value; }
        }
        #endregion

        #region Previous Month Region
        private Rectangle mPreviousMonthRegion = Rectangle.Empty;
        /// <summary>
        /// Gets/Sets region for previous month selector.
        /// </summary>
        public Rectangle PreviousMonthRegion
        {
            get { return mPreviousMonthRegion; }
            set { mPreviousMonthRegion = value; }
        }
        #endregion

        #region Next Month Region
        private Rectangle mNextMonthRegion = Rectangle.Empty;
        /// <summary>
        /// Gets/Sets region for next month selector.
        /// </summary>
        public Rectangle NextMonthRegion
        {
            get { return mNextMonthRegion; }
            set { mNextMonthRegion = value; }
        }
        #endregion

        #region Previous Year Region
        private Rectangle mPreviousYearRegion = Rectangle.Empty;
        /// <summary>
        /// Gets/Sets region for previous year selector.
        /// </summary>
        public Rectangle PreviousYearRegion
        {
            get { return mPreviousYearRegion; }
            set { mPreviousYearRegion = value; }
        }
        #endregion

        #region Next Year Region
        private Rectangle mNextYearRegion = Rectangle.Empty;
        /// <summary>
        /// Gets/Sets region for next year selector.
        /// </summary>
        public Rectangle NextYearRegion
        {
            get { return mNextYearRegion; }
            set { mNextYearRegion = value; }
        }
        #endregion

        #region Title Region
        private Rectangle mTitleRegion = Rectangle.Empty;
        /// <summary>
        /// Gets/Sets region of the title.
        /// </summary>
        public Rectangle TitleRegion
        {
            get { return mTitleRegion; }
            set { mTitleRegion = value; }
        }
        #endregion

        #region Today Region
        private Rectangle mTodayRegion = Rectangle.Empty;
        /// <summary>
        /// Gets/Sets region for today section.
        /// </summary>
        public Rectangle TodayRegion
        {
            get { return mTodayRegion; }
            set { mTodayRegion = value; }
        }
        #endregion

        #region Body Region
        private Rectangle mBodyRegion = Rectangle.Empty;
        /// <summary>
        /// Gets/Sets region of the body (calendar + today)
        /// </summary>
        public Rectangle BodyRegion
        {
            get { return mBodyRegion; }
            set { mBodyRegion = value; }
        }
        #endregion

        #region Days Region
        private Rectangle mDaysRegion = Rectangle.Empty;
        /// <summary>
        /// Gets/Sets region for day names.
        /// </summary>
        public Rectangle DaysRegion
        {
            get { return mDaysRegion; }
            set { mDaysRegion = value; }
        }
        #endregion

        #region Calendar Region
        private Rectangle mCalendarRegion = Rectangle.Empty;
        /// <summary>
        /// Gets/Sets region for main calendar.
        /// </summary>
        public Rectangle CalendarRegion
        {
            get { return mCalendarRegion; }
            set { mCalendarRegion = value; }
        }
        #endregion

        #region Start Row
        private int mStartRow;
        /// <summary>
        /// Gets/Sets which row the first day of this month is.
        /// </summary>
        public int StartRow
        {
            get { return mStartRow; }
            set { mStartRow = value; }
        }
        #endregion

        #region End Row
        private int mEndRow;
        /// <summary>
        /// Gets/Sets which row the last day of this month is.
        /// </summary>
        public int EndRow
        {
            get { return mEndRow; }
            set { mEndRow = value; }
        }
        #endregion

        #region Start Column
        private int mStartColumn;
        /// <summary>
        /// Gets/Sets which column the first day of this month is.
        /// </summary>
        public int StartColumn
        {
            get { return mStartColumn; }
            set { mStartColumn = value; }
        }
        #endregion

        #region End Column
        private int mEndColumn;
        /// <summary>
        /// Gets/Sets which column the lasts day of this month is.
        /// </summary>
        public int EndColumn
        {
            get { return mEndColumn; }
            set { mEndColumn = value; }
        }
        #endregion

        #region Columns
        private int[] mColumns = new int[8];
        /// <summary>
        /// Gets/Sets column coordinates (array of 8).
        /// </summary>
        public int[] Columns
        {
            get { return mColumns; }
            set { mColumns = value; }
        }
        #endregion

        #region Rows
        private int[] mRows = new int[7];
        /// <summary>
        /// Gets/Sets row coordinates (array of 7).
        /// </summary>
        public int[] Rows
        {
            get { return mRows; }
            set { mRows = value; }
        }
        #endregion

        #region Dates
        private int[][] mDates;
        /// <summary>
        /// Gets/Sets a matrix of dates value to be displayed (rows x columns = 7 x 8).
        /// </summary>
        public int[][] Dates
        {
            get { return mDates; }
            set { mDates = value; }
        }
        #endregion

        #region Display Date
        private DateTime mDisplayDate = DateTime.Now;
        /// <summary>
        /// Gets/Sets the date to be displayed.
        /// </summary>
        public DateTime DisplayDate
        {
            get { return mDisplayDate; }
            set
            {
                mDisplayDate = value;
            }
        }
        #endregion

        #region Today Index
        private int mTodayIndex = -1;
        /// <summary>
        /// Gets/Sets index of Today (in Dates matrix, index = rows x 8 + column).
        /// A value of -1 means today is not visible.
        /// </summary>
        public int TodayIndex
        {
            get { return mTodayIndex; }
            set { mTodayIndex = value; }
        }
        #endregion

        #region Selected Index
        private int mSelectedIndex = -1;
        /// <summary>
        /// Gets/Sets index of Selected date (in Dates matrix, index = rows x 8 + column).
        /// A value of -1 means today is not visible.
        /// </summary>
        public int SelectedIndex
        {
            get { return mSelectedIndex; }
            set { mSelectedIndex = value; }
        }
        #endregion

        #region Is Mouse Over
        private bool mIsMouseOver;
        /// <summary>
        /// Gets/Sets whether mouse is hovering on the control.
        /// </summary>
        public bool IsMouseOver
        {
            get { return mIsMouseOver; }
            set { mIsMouseOver = value; }
        }
        #endregion


        #region Constructors
        /// <summary>
        /// Default constructor.
        /// </summary>
        public CalendarRenderContext()
        {
            mDates = new int[7][];
            for (int i = 0; i < mDates.Length; i++)
            {
                mDates[i] = new int[8];
            }
        }
        #endregion
    }
}
